﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mongaba.Core.Enumerators;
using System.ServiceModel;
using System.Runtime.Serialization;
using Mongaba.Core.DataContracts;

namespace Mongaba.Core.ServiceContracts
{
    [ServiceContract(Name = "IMongabaCoordinator", ProtectionLevel = System.Net.Security.ProtectionLevel.None, SessionMode= SessionMode.Allowed)]
    interface IMongabaCoordinator
    {
        [OperationContract(Name = "getProcesses", IsOneWay = false)]
        ProcessContract[] getProcesses();

        [OperationContract(Name = "RegisterProcess", IsOneWay = false)]
        bool RegisterProcess(ProcessContract p);

        [OperationContract(Name = "UnRegisterProcess", IsOneWay = true)]
        void UnRegisterProcess(string processId);

        [OperationContract(Name = "getGroup", IsOneWay = false)]
        GroupContract getGroup();

        [OperationContract(Name = "getID", IsOneWay = false)]
        string getId();

        [OperationContract(Name = "getStatus", IsOneWay = false)]
        CoordinatorStatus getStatus();

        [OperationContract(Name = "getKnownCoordinators", IsOneWay = false)]
        CoordinatorContract[] getKnownCoordinators();

        [OperationContract(Name = "getContract", IsOneWay = false)]
        CoordinatorContract getContract();

        [OperationContract(Name = "Ping", IsOneWay = false)]
        bool Ping();

        [OperationContract(Name = "getHostProcessContract", IsOneWay = false)]
        ProcessContract getHostProcessContract();

        [OperationContract(Name = "ReceiveNewCoordinator", IsOneWay = true)]
        void ReceiveNewCoordinator(CoordinatorContract coord);
    }
}
